﻿{% extends "gma/base.html" %}
{% load static %}
{% load mytag %}

<!-- CONTENT
  =====================================================================-->

{% block content %}

<div class="page__hd">
    <h1 class="page__title">
        <i class="fa fa-robot weui_grid_icon_fa" style="font-size: 32px;"> </i> 用户行为分析
    </h1>
    <p class="page__desc"> {{ data_title }} </p>
</div>

<div class="page__bd">
    <div class="weui-cells__title"> 选择渠道 </div>
    <div class="weui-cells">
        <div class="weui-cell weui-cell_select weui-cell_select-after">
            <div class="weui-cell__hd">
                <label for="" class="weui-label">渠道</label>
            </div>
            <div class="weui-cell__bd">
                <select class="weui-select" name="channel" id="channel">
                    {% for channel in channels %}
                    <option value="{{ channel }}">{{ channel }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>
    </div>

    <div class="weui-cells__title"> 选择日期 </div>
    <div class="weui-cells">
        {% for batch, begin, end in days %}
        <a class="weui-cell weui-cell_access" href="javascript:fake_detect('{{ batch }}')">
            <div class="weui-cell__bd"> <p> <i class="fa fa-calendar-alt"></i>  {{ batch }} </p> </div>
            <div class="weui-cell__ft"> </div>
        </a>
        {% endfor %}
    </div>
</div>

<div class="page__ft">
    <a href="{% url 'gma:home' %}">
        <span class="bottom-logo">
           HiBao
       </span>
    </a>
</div>

{% endblock content %}


<!-- SCRIPT
  =====================================================================-->

{% block extra_js %}

<script>
function fake_detect(batch) {
    const channel = $('#channel').val();
    let url = `/gma/stat/fake/${channel}/${batch}/`;
    window.location = url;
}
</script>
{% endblock extra_js %}